package team240;

import battlecode.common.*;

public class AirRobot extends Robots{
	RobotController myRC;

	public AirRobot(RobotController inRC) {
		super(inRC);
		myRC = inRC;
	}
	public void runAirRobot() {
		while (true) {
			try {
				if (myRC.getRobotType() == RobotType.ARCHON) {
					Archon myArchon = new Archon(myRC);
					myArchon.runArchon();
				}
				else {
					Scout myScout = new Scout(myRC);
					myScout.runScout();
				}
			}catch(Exception e) {
	            System.out.println("caught exception:");
	            e.printStackTrace();
	        }
		}
	}
	//insert other air robot methods here
	public void moveTowardLocation(MapLocation goal) {
		//move one step closer toward a given location
		//you need to check if movement is active before calling this method
		if (myRC.getLocation() != goal) {
			moveInDirection(getDirection(myRC.getLocation(),goal));
		}
	}
	public void moveInDirection(Direction heading) {
		//move one step in a given direction
		//you need to check if movement is active before calling this method
		moveOneInDirection(heading);
	}
}
